package com.yunhe.marketing.service;

import com.alibaba.fastjson.JSONObject;
import com.github.stuxuhai.jpinyin.PinyinException;
import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.exception.UniqueConstraintsException;
import com.yunhe.common.model.mybatis.PageResult;
import com.yunhe.marketing.domain.Enterprise;
import com.yunhe.marketing.domain.FilterCondition;
import com.yunhe.marketing.model.DemandFilterCondition;
import com.yunhe.marketing.model.EnterpriseUpload;
import com.yunhe.marketing.model.EnterpriseUploadAQC;

import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.List;

/**
 * @Author: DongWenYu
 * @Date: 2021/2/23 10:37
 */
public interface IDemandRepositoryService {

    /**
     * 导入数据
     * @param enterpriseUploadList 导入的企业集合
     * @return java.util.List<com.yunhe.marketing.domain.Enterprise>
     * @create 2021/2/26 15:56
     */
    List<Enterprise> upload(List<EnterpriseUpload> enterpriseUploadList,String channelSource) throws PinyinException;

    /**
     * 导入数据
     * @param enterpriseUploadAQCList 导入的企业集合
     * @return java.util.List<com.yunhe.marketing.domain.Enterprise>
     * @create 2021/2/26 15:56
     */
    List<Enterprise> uploadAQC(List<EnterpriseUploadAQC> enterpriseUploadAQCList) throws PinyinException;

    /**
     * 导出数据
     * @param ids 导出的企业id
     * @param exportPeopleId 导出人的id
     * @return List<Enterprise>
     * @create 2021/2/26 15:56
     */
    List<Enterprise>  export(String ids , Long exportPeopleId, HttpServletResponse httpServletResponse);

    /**
     * 分配任务
     * @param ids 导出的企业id
     * @param responsiblePersonId 负责人的id
     * @return java.util.List<com.yunhe.marketing.domain.Enterprise>
     * @create 2021/2/26 15:57
     */
    List<Enterprise> assign(String ids , Long responsiblePersonId) throws ArgumentErrorException;

    /**
     * 分页展示筛选后的需求
     * @param demandFilterCondition 筛选条件
     * @return com.yunhe.common.model.mybatis.PageResult
     * @create 2021/2/26 15:58
     */
    PageResult selectDemandByDemandQueryCondition(DemandFilterCondition demandFilterCondition , int page , int size) throws ParseException;

    /**
     * @Description 保存需求筛选条件
     * @Param String conditionName, ClueQueryCondition
     * @Return int
     * @Date 2021/2/25 17:32
     */
    FilterCondition saveDemandFilterCondition(Long userId , String conditionName , DemandFilterCondition demandFilterCondition) throws UniqueConstraintsException;

    /**
     * @Description 查看已保存的条件组
     * @Param Long userId
     * @Return List<FilterCondition>
     * @Date 2021/2/26 14:06
     */
    PageResult viewSavedFilterCondition(Long userId ,int page, int size);

    /**
     * @Description 根据关键字搜索条件组
     * @Param Long userId, String keyName
     * @Return List<FilterCondition>
     * @Date 2021/2/26 14:07
     */
    PageResult selectFilterConditionByKeyName(Long userId, String keyName, int page, int size);

    /**
     * @Description 根据条件组ID删除条件组
     * @Param Long id
     * @Return int
     * @Date 2021/2/26 14:48
     */
    int deleteById(Long id);

    /**
     * @Description 根据企业id查询需求（查看需求详情）
     * @Param Long id
     * @Return Enterprise
     * @Date 2021/2/26 17:39
     */
    Enterprise selectDemandById(Long id);

    FilterCondition selectFilterConditionByConditionId(Long id);

}
